package com.symria.framework.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class PropertiesUtil {
   public Properties properties = null;
   public String source = null;
   PropertiesUtil(){
	   
   }
   PropertiesUtil(String source){
	   this.source = source;
   }
   public static PropertiesUtil createPropertiesUtil(String source){
	   return new PropertiesUtil(source);
   }
   public void loadProperties(){
	try {
		InputStream  in = getClass().getClassLoader().getResource(source).openStream();
		properties = new Properties();
		properties.load(in);
	} catch (IOException e) {
		e.printStackTrace();
	}
   }
   public String getProperty(String key){
	   if(properties!=null){
		   return properties.getProperty(key);
	   };return null;
   }
}
